﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Manzana;
using System.Diagnostics;
using System.ComponentModel;

namespace IVR3_Downloader.Class
{
    internal class Ivr3iPhone
    {
        private static Ivr3iPhone __ivr3iPhone = null;

        private iPhone _iPhone = null;
        private BackgroundWorker _backgroundWorker = null;

        

        private Ivr3iPhone()
        {
            this._iPhone = new iPhone(iPhone_Connect, iPhone_Disconnect);
            this._iPhone.ReConnect();


            String d = this._iPhone.DeviceName;
          

        }

        #region Properties
        public BackgroundWorker BackgroundWorker
        {
            set
            {
                this._backgroundWorker = value;
            }
        }
        #endregion

        #region Methods
        public String[] ListVideos()
        {
            String[] files = this._iPhone.GetFiles("private/var/mobile/media/iphonevideorecorder");


            return files;
        }


        #endregion


        #region Events
        private void iPhone_Disconnect(object sender, ConnectEventArgs args)
        {
            Debug.WriteLine("iPhone Disconnected");
        }

        private void iPhone_Connect(object sender, ConnectEventArgs args)
        {
            Debug.WriteLine("iPhone Connect");
        }
        #endregion



        #region Static
        /// <summary>
        /// Get singleton instance.
        /// </summary>
        public static Ivr3iPhone Instance
        {
            get
            {
                if (Ivr3iPhone.__ivr3iPhone == null)
                {
                    Ivr3iPhone.__ivr3iPhone = new Ivr3iPhone();
                }

                return Ivr3iPhone.__ivr3iPhone;
            }
        }
        #endregion
    }
}
